/**
 * 
 */
package com.sesame.daoimpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sesame.dao.ShareDAO;
import com.sesame.domain.Share;

/**
 * @author voidman
 * 
 */
public class ShareDAOImpl extends SqlMapClientDaoSupport implements ShareDAO {

    public void addShare(Share Share) {
        getSqlMapClientTemplate().insert("addShare", Share);
    }

    public void deleteShareById(Integer id) {
        getSqlMapClientTemplate().delete("deleteShareById", id);
    }

    @SuppressWarnings("unchecked")
    public List<Share> getAllShare() {
        List<Share> listShare;
        listShare = getSqlMapClientTemplate().queryForList("getAllShare");
        return listShare;
    }
    
    public Share getShareById(Integer id) {

        return (Share) getSqlMapClientTemplate().queryForObject("getShareById", id);
    }

    public void updateShare(Share Share) {
        getSqlMapClientTemplate().update("updateShare", Share);
    }

}
